package gdg.tijuana.android.app;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.Toast;

public class GDGTijuanaActivity extends Activity {
    private static final String TAG = "GDG Tijuana";

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
    	Context context = getApplicationContext();
        CharSequence text = "Abriendo nuestro sitio!";
        int duration = Toast.LENGTH_SHORT;
        
        Log.i(TAG,"Toast: " + text);
        Toast toast = Toast.makeText(context, text, duration);
        toast.show();
        
        Log.i(TAG,"5 Segundos de Espera.");
        try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
		}
        
        Uri direccion = Uri.parse("http://gtug.mx");
        Log.i(TAG,"" + direccion.toString());
        Intent surf = new Intent(Intent.ACTION_VIEW, direccion);
        startActivity(surf);
        
        Log.i(TAG,"onCreate Terminando");
        
    	// TODO Auto-generated method stub
    	return super.onTouchEvent(event);
    }
    
}